(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  ["pages/user/qrcode/qrcode"], {
    "03a8": function (t, e, a) {
      "use strict";
      (function (t) {
        Object.defineProperty(e, "__esModule", {
          value: !0
        }), e.default = void 0;
        var n = c(a("a34a")),
          s = c(a("a103"));

        function c(t) {
          return t && t.__esModule ? t : {
            default: t
          }
        }

        function o(t, e, a, n, s, c, o) {
          try {
            var r = t[c](o),
              i = r.value
          } catch (u) {
            return void a(u)
          }
          r.done ? e(i) : Promise.resolve(i).then(n, s)
        }

        function r(t) {
          return function () {
            var e = this,
              a = arguments;
            return new Promise((function (n, s) {
              var c = t.apply(e, a);

              function r(t) {
                o(c, n, s, r, i, "next", t)
              }

              function i(t) {
                o(c, n, s, r, i, "throw", t)
              }
              r(void 0)
            }))
          }
        }
        var i = {
          data: function () {
            return {
              QRCodeText: "水电费水电费水电费是的是的发送到发送到",
              QRCodeSrc: "",
              huodong:"",
              posterSrc: "",
              posterSrc2:"",
              postercanvas_width: 0,
              postercanvas_height: 0,
              posterTemplates: []
            }
          },
          onLoad: function (e) {

            t.showLoading({
              title: "二维码生成中",
              mask: !0
            }), e.url ? this.QRCodeText = e.url : this.QRCodeText = this.$store.state.common.appConfig.domain + "/pages/user/info?id=" + this.$store.state.user.id + "&QRtype=user", this.loadData()
          },
          methods: {


            gogo: function () {
              var e = this;
              return e.$wanlshop.auth("/pages/user/help2")
            },


            loadData: function (e) {
              var a = this;
              return r(n.default.mark((function e() {
                return n.default.wrap((function (e) {
                  while (1) switch (e.prev = e.next) {
                    case 0:
                      a.$api.post({
                        url: "/wanlshop/common/qrcode?uid="+wx.getStorageSync("wanlshop:user").id,
                        success: function (e) {


                          a.posterSrc = e[0].thumbnail_url
                          a.posterSrc2 = e[0].thumbnail_url
                          a.huodong = e[1].thumbnail_url
                          e.forEach((function (e, n, s) {
                            "wanlshopqr" != e.template && (t.downloadFile({
                              url: a.$wanlshop.oss(e.background_url, 350, 0),
                              success: function (t) {
                                e.background_url = t.tempFilePath
                              }
                            }), t.downloadFile({
                              url: a.$wanlshop.oss(e.logo_src, 40, 40),
                              success: function (t) {
                                e.logo_src = t.tempFilePath
                              }
                            }))
                          })), a.posterTemplates = e, 0 == e.length ? t.showModal({
                            title: "重要提示",
                            content: "平台尚未配置二维码，请到后台系统管理【配置二维码】",
                            success: function (t) {
                              a.$wanlshop.back(1)
                            }
                          }) : t.showLoading({
                            title: "加载配置中",
                            mask: !0
                          }), s.default.make({
                            canvasId: "qrcode",
                            text: a.QRCodeText,
                            size: 200,
                            success: function (t) {
                              a.QRCodeSrc = t, a.create(a.posterTemplates[0])
                            }
                          })



                        }
                      });
                    case 1:
                    case "end":
                      return e.stop()
                  }
                }), e)
              })))()


            },
            create: function (e) {

              var a = this;
              e.checked || (t.showLoading({
                title: "海报生成中",
                mask: !0
              }), this.posterTemplates.forEach((function (t) {
                t.checked = !1
              })), e.checked = !0, this.postercanvas_width = e.canvas_width, this.postercanvas_height = e.canvas_height,
              //  this.posterSrc = "",
               setTimeout((function () {
                switch (e.template) {
                  case "wanlshopqrlist001":
                    a.wanlshopqrlist001({
                      canvasId: "poster",
                      canvas_width: e.canvas_width,
                      canvas_height: e.canvas_height,
                      backgroundSrc: e.background_url,
                      logoSrc: e.logo_src,
                      name: a.$store.state.user.username,
                      text: "长按扫描二维码~",
                      QRCodeSrc: a.QRCodeSrc,
                      success: function (e) {

                        //这里填活动图的src
                        a.posterSrc = a.huodong,
                        t.hideLoading()
                      }
                    });
                    break;
                  case "wanlshopqr":
                    a.wanlshopqr({
                      canvasId: "poster",
                      canvas_width: e.canvas_width,
                      canvas_height: e.canvas_height,
                      QRCodeSrc: a.QRCodeSrc,
                      success: function (e) {
                        a.posterSrc = a.posterSrc2,

                        t.hideLoading()
                      }
                    });
                    break
                }
              }), 100))
            },
            save: function () {
              var e = this;
              t.saveImageToPhotosAlbum({
                filePath: this.posterSrc,
                success: function () {
                  e.$wanlshop.msg("保存成功")
                }
              })
            },
            wanlshopqrlist001: function (e) {
              var a = e.canvas_width,
                n = e.canvas_height,
                s = e.backgroundSrc,
                c = e.logoSrc,
                o = e.name,
                r = e.text,
                i = e.QRCodeSrc,
                u = t.createCanvasContext(e.canvasId);
              u.clearRect(0, 0, a, n);
              var l = {
                  width: "500",
                  height: "667"
                },
                d = a,
                h = l.height * a / l.width;
              u.drawImage(s, 0, 0, d, h);
              var f = 80,
                p = 80,
                v = 36,
                g = h + (n - h) / 2 - p / 2;
              u.save(), u.beginPath(), u.arc(f / 2 + v, p / 2 + g, f / 2, 0, 2 * Math.PI, !1), u.closePath(), u.clip(), u.drawImage(c, v, g, f, p), u.restore(), o.length > 10 && (o = o.substring(0, 10) + "...");
              var m = v + f + 10,
                w = g + 32,
                _ = 20;
              u.setFillStyle("#000000"), u.setFontSize(_), u.fillText(o, m, w);
              var b = m,
                S = w + 32,
                T = 16;
              u.setFillStyle("#999999"), u.setFontSize(T), u.fillText(r, b, S);
              var k = 100,
                C = 100,
                I = a - k - 36,
                P = h + (n - h) / 2 - C / 2;
              u.drawImage(i, I, P, k, C), u.draw(!1, (function () {
                t.canvasToTempFilePath({
                  canvasId: e.canvasId,
                  fileType: "jpg",
                  success: function (t) {
                    e.success && e.success(t.tempFilePath)
                  }
                })
              }))
            },
            wanlshopqr: function (e) {
              var a = e.canvas_width,
                n = e.canvas_height,
                s = e.QRCodeSrc,
                c = t.createCanvasContext(e.canvasId);
              c.clearRect(0, 0, a, n), c.drawImage(s, 15, 15, a - 30, n - 30), c.draw(!1, (function () {
                t.canvasToTempFilePath({
                  canvasId: e.canvasId,
                  fileType: "jpg",
                  success: function (t) {
                    e.success && e.success(t.tempFilePath)
                  }
                })
              }))
            }
          }
        };
        e.default = i
      }).call(this, a("543d")["default"])
    },
    "473c": function (t, e, a) {
      "use strict";
      a.r(e);
      var n = a("03a8"),
        s = a.n(n);
      for (var c in n) "default" !== c && function (t) {
        a.d(e, t, (function () {
          return n[t]
        }))
      }(c);
      e["default"] = s.a
    },
    8345: function (t, e, a) {
      "use strict";
      a.r(e);
      var n = a("98f2"),
        s = a("473c");
      for (var c in s) "default" !== c && function (t) {
        a.d(e, t, (function () {
          return s[t]
        }))
      }(c);
      a("a95a");
      var o, r = a("f0c5"),
        i = Object(r["a"])(s["default"], n["b"], n["c"], !1, null, null, null, !1, n["a"], o);
      e["default"] = i.exports
    },
    "98f2": function (t, e, a) {
      "use strict";
      var n;
      a.d(e, "b", (function () {
        return s
      })), a.d(e, "c", (function () {
        return c
      })), a.d(e, "a", (function () {
        return n
      }));
      var s = function () {
          var t = this,
            e = t.$createElement,
            a = (t._self._c, t.__map(t.posterTemplates, (function (e, a) {
              var n = t.__get_orig(e),
                s = t.$wanlshop.oss(e.thumbnail_url, 0, 88);
              return {
                $orig: n,
                g0: s
              }
            })));
          t.$mp.data = Object.assign({}, {
            $root: {
              l0: a
            }
          })
        },
        c = []
    },
    a95a: function (t, e, a) {
      "use strict";
      var n = a("f4c7"),
        s = a.n(n);
      s.a
    },
    f4c7: function (t, e, a) {},
    fda4: function (t, e, a) {
      "use strict";
      (function (t) {
        a("77a0");
        n(a("66fd"));
        var e = n(a("8345"));

        function n(t) {
          return t && t.__esModule ? t : {
            default: t
          }
        }
        t(e.default)
      }).call(this, a("543d")["createPage"])
    }
  },
  [
    ["fda4", "common/runtime", "common/vendor"]
  ]
]);
